//
//  HotPostTableViewCell.m
//  DFForum
//
//  Created by lanou on 15/10/23.
//  Copyright © 2015年 lanou. All rights reserved.
//
#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
#import "HotPostTableViewCell.h"

@implementation HotPostTableViewCell




- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, kScreenWidth - 10, 40)];
        _titleLabel.backgroundColor = [UIColor grayColor];
        _titleLabel.font = [UIFont systemFontOfSize:13];
        _titleLabel.numberOfLines = 0;
        [self.contentView addSubview:_titleLabel];
        
        CGFloat lx = (kScreenWidth - 15) / 3;
        _aImage = [[UIImageView alloc] initWithFrame:CGRectMake(5, 50, lx, lx * 3 / 4)];
        _aImage.backgroundColor = [UIColor grayColor];
        _bImage = [[UIImageView alloc] initWithFrame:CGRectMake(7.5 + lx, 50, lx, lx * 3 / 4)];
        _bImage.backgroundColor = [UIColor grayColor];
        _cImage = [[UIImageView alloc] initWithFrame:CGRectMake(10 + lx * 2, 50, lx, lx * 3 / 4)];
        _cImage.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:_aImage];
        [self.contentView addSubview:_bImage];
        [self.contentView addSubview:_cImage];
        
        CGFloat ly = 55 + lx * 3 / 4;
        _authorImg = [[UIImageView alloc] initWithFrame:CGRectMake(5, ly, 18, 18)];
        _authorImg.backgroundColor = [UIColor grayColor];
        _authorImg.layer.cornerRadius = 9;
        _authorImg.layer.masksToBounds = YES;
        [self.contentView addSubview:_authorImg];
        
        _authorNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(28, ly + 3, kScreenWidth / 2, 12)];
        _authorNameLabel.backgroundColor = [UIColor grayColor];
        _authorNameLabel.font = [UIFont systemFontOfSize:10];
        [self.contentView addSubview:_authorNameLabel];
        
        _replyLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth + 50, ly + 3, 60, 12)];
        _replyLabel.backgroundColor = [UIColor grayColor];
        _replyLabel.font = [UIFont systemFontOfSize:10];
        [self.contentView addSubview:_replyLabel];
        
        _replyTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth - 70, ly + 3, 65, 12)];
        _replyTimeLabel.font = [UIFont systemFontOfSize:10];
        _replyTimeLabel.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:_replyTimeLabel];
        
        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, ly + 23, 100, 12)];
        _timeLabel.backgroundColor = [UIColor grayColor];
        _timeLabel.font = [UIFont systemFontOfSize:10];
        [self.contentView addSubview:_timeLabel];
        
        _typeName = [[UILabel alloc] initWithFrame:CGRectMake(115, ly + 23, 30, 12)];
        _typeName.backgroundColor = [UIColor grayColor];
        _typeName.font = [UIFont systemFontOfSize:10];
        [self.contentView addSubview:_typeName];
        
        _supportLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth - 80, ly + 20, 60, 18)];
        _supportLabel.backgroundColor = [UIColor grayColor];
        _supportLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_supportLabel];
        
        _supportBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        [_supportBtn setBackgroundImage:[UIImage imageNamed:@"support"] forState:UIControlStateNormal];
        _supportBtn.frame = CGRectMake(kScreenWidth - 80, ly + 23, 15, 15);
        [_supportLabel addSubview:_supportBtn];
        
    }
    return self;
}







- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
